<?php

namespace NanQi\Hope\Test;

use Carbon\Carbon;
use NanQi\Hope\Service\JwtService;
use PHPUnit\Framework\TestCase;

class JwtTest extends TestCase {

    public function testJwt()
    {
        /** @var JwtService $jwtService */
        $jwtService = di(JwtService::class);
        
        $rand = mt_rand(1, 1000);
        $jwt = $jwtService->getToken($rand, [], Carbon::now(), 30);
        var_dump($jwt);

        $res = $jwtService->checkToken();

        var_dump($res);

//        $this->assertArrayHasKey('name', $res);
//        $this->assertEquals($rand, $res['id']->getValue());
        $this->assertTrue(true);
    }
}



